<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/3/2 0002
  Time: 15:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
&nbsp;&nbsp;报文：
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" id="submit" value="提交" ></input>
<p></p>
&nbsp;&nbsp;<textarea rows="25" cols="100" id="content">
{
	"applicationId": 6,
	"companyId": 11,
	"createTime": 1551505688000,
	"data": {
		"electricity": 98.26,
		"value": 1
	},
	"dataTypeId": 160,
	"deviceName": "test001",
	"deviceSecret": "p91tgqDGrVgU9Sg4JOI9tbjDOitYYCiv",
	"deviceTypeCode": 260,
	"eventId": 1,
	"networkType": 5,
	"periodId": "9f67e48c-bb6b-4d31-8337-0707876d4ce8",
	"productKey": "uxUkmTA3Ksw",
	"requestId": "b35e08d9-f155-4539-ad03-aa13edc13f4c",
	"timeStamp": 1548687286,
	"version": 2
}
</textarea>
<p></p>
<script language="JavaScript">
    $("body").on("click","#submit",function(){
        var str = $("#content").val();
        var reqStr="str="+str;
        //console.log(editData);
        //发送批量编辑请求
        $.ajax({
            type: "POST",
            url: ctx+"/mqttPost.do",
            data: reqStr,
            dataType: "json",
            success: function(result){
                if(result=="1"){
                    //alert("code:"+result.code);
                    alert('操作成功');
                }else{
                    alert('操作失败：');
                }
            }
        });
    });
</script>
</body>
</html>
